package com.liang.index334.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author liangyehao
 * @version 1.0
 * @date 2021/5/1 18:38
 * @content
 */
@Data
public class CodeResult {

    @ExcelProperty("门店")
    private String stores;
    @ExcelProperty("店组")
    private String storesGroup;
    @ExcelProperty("经纪人姓名")
    private String agentName;
    @ExcelProperty("扫码量")
    private Integer codeAmount;
    @ExcelProperty("月均码上有客")
    private BigDecimal codeGuest;
    @ExcelProperty("是否达标")
    private String codeFlunk;

    public void setCodeAmount(Integer codeAmount, int days){
        this.codeAmount = codeAmount;
        this.codeGuest = BigDecimal.valueOf((double)codeAmount/days);
        this.codeFlunk = this.codeGuest.compareTo(BigDecimal.valueOf(4L))>=0?"已达标":"预警关黑";
    }

}
